import sys
import logging

# 配置日志
logging.basicConfig(
    level=logging.DEBUG,
    format='%(asctime)s [%(levelname)s] %(message)s',
    handlers=[logging.StreamHandler()]
)
logger = logging.getLogger(__name__)

try:
    logger.info("Starting to import app...")
    from app import app
    logger.info("App imported successfully")
except Exception as e:
    logger.error(f"Error importing app: {str(e)}")
    logger.error(f"Python path: {sys.path}")
    raise

if __name__ == "__main__":
    app.run()
